/*
 * Lamp.java
 *
 * Created on September 27, 2007, 10:14 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package Raytracing;
import processing.core.*;


public class Lamp {
    
    int color;
    public PVector origin;
    
    /** Creates a new instance of Lamp */
    public Lamp(PVector origin,  int color) {
        this.origin = origin;
        this.color = color;
    }
    
    public boolean getSample(Ray state, Integer color){
        state.direction = PVector.sub(origin,state.origin);
        state.maxDist = state.direction.mag();
        state.direction.div(state.maxDist);
        return true;
    
    }

    public int getColor() {
        return color;
    }
    
    public void draw(PApplet g, float radius){
    
        g.fill(255,255,0);
        g.noStroke();
        g.pushMatrix();
        g.translate(origin.x,origin.y,origin.z);
        g.sphere(radius);
        g.popMatrix();
    
    }
    
}
